//
//  ViewController.swift
//  Draw方法的逐步帧动画效果
//
//  Created by app on 2017/4/13.
//  Copyright © 2017年 app. All rights reserved.
//

import UIKit

class ViewController: UIViewController {

    var blackHole:BlackHoleView!
    var time:Timer!
    var index:CGFloat = 0
    override func viewDidLoad() {
        super.viewDidLoad()
        
        blackHole = BlackHoleView()
        blackHole.frame = UIScreen.main.bounds
        blackHole.backgroundColor = UIColor.cyan
        view.addSubview(blackHole)
        
        time = Timer.scheduledTimer(timeInterval: 1.0 / 30, target: self, selector: #selector(refushImage), userInfo: nil, repeats: true)
        
    }
    
    func refushImage() {
        blackHole.blackHoleIncrease(Float(index))
        
    }

}

